<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >

    <ui:composition template="layout.xhtml">

        <ui:define name="corpo">
            <h:form id="usuario_form" acceptcharset="utf-8"> 
                <div id="breadcrumb">
                    <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                    <p:commandLink  actionListener="#{managerIndex.redirect('criarAcesso.xhtml')}" value="Usuário" update="@form" immediate="true"/> >
                    <p:commandLink  value="Editar Usuário" update="@form" immediate="true"/>
                </div>
                <p:panel header="Editar Usuário">
                     <p:messages id="msg"/>
                    <fieldset>
                        <legend>Dados do Usuário</legend>
                        
                        <div style="float:right;">
                            <h:outputText value="Usuário Ativo: " />
                            <h:selectBooleanCheckbox value="#{managerEditarUsuario.usuario.status}"  />
                        </div>
                        
                        <h:panelGrid columns="2" id="dadosUsr" border="0" styleClass="textAlignRight" columnClasses="textAlignRight"> 
                            <h:outputLabel value=" Sexo: " />  
                            <p:selectOneRadio id="sexo" value="#{managerEditarUsuario.usuario.sexo}"  
                                              label="Sexo">  
                                <f:selectItems value="#{managerEditarUsuario.selectItemSexo()}"/>                     
                            </p:selectOneRadio>
                            
                            <h:outputLabel value="Nome: "/>
                            <p:inputText value="#{managerEditarUsuario.usuario.nome}"
                                         id="nome_user"
                                         required="true" size="60" 
                                         requiredMessage="O campo nome deve ser preenchido "/>

                            <h:outputLabel value="Rg:"/>  
                            <p:inputText value="#{managerEditarUsuario.usuario.rg}" 
                                         id="rg_user" maxlength="11" style="width: 165px"/>
                            <h:outputLabel value="Cpf:"/>  
                            <p:inputMask value="#{managerEditarUsuario.usuario.cpf}" 
                                         id="cpf_user" mask="999.999.999-99"   maxlength="11" style="width: 165px"/> 
                            
                            <h:outputLabel value="Email:"/>  
                            <p:inputText value="#{managerEditarUsuario.usuario.email}" 
                                         id="email_user" required="true"
                                         requiredMessage="o campo email deve ser preenchido" size="60" maxlength="100"/>
                            <h:outputLabel value="Telefone:"/>  
                            <p:inputMask value="#{managerEditarUsuario.usuario.contato}" 
                                         id="contato_user" mask="99-9999-9999"   maxlength="11" style="width: 165px"/> 
                            
                        </h:panelGrid>
                    </fieldset>
                    <br/>
                    <br/>
                    <fieldset>
                        <legend>Informações ao Sistema</legend>
                        
                        <h:panelGrid columns="2" id="dadosAP"  border="0"  styleClass="textAlignRight" columnClasses="textAlignRight">
                            <h:outputLabel value="Atividade Profissional:"/>
                            <p:inputText value="#{managerEditarUsuario.usuario.cargo}" size="50"/>
                        </h:panelGrid>
                            <p:pickList id="picklistGrupos" style="margin-top: 10px"
                                        value="#{managerEditarUsuario.dualGrupo}" var="grupo"
                                        itemLabel="#{grupo.descricao}" converter="grupoConverter" itemValue="#{grupo}">
                                        <f:facet name="sourceCaption">Grupo</f:facet>	
                                        <f:facet name="targetCaption">Grupo Selecionados</f:facet>
                            </p:pickList>
                    </fieldset>
                    <div class="buttonAction">
                        <p:commandButton icon="ui-icon-disk" value="Salvar" 
                                         actionListener="#{managerEditarUsuario.editar()}"
                                         update="msg, dadosUsr, dadosAP" process="@form" />
                        <p:commandButton icon="ui-icon-arrowreturnthick-1-w" value="Cancelar"
                                         actionListener="#{managerVisualizarUsuario.redirect('criarAcesso.xhtml') }" 
                                         immediate="true" />
                    </div>
                </p:panel>     


            </h:form>  

        </ui:define>


    </ui:composition> 

</html>